package com.itboye.sunsun.forum.ui;

import java.util.ArrayList;

import com.itboye.sunsun.R;
import com.itboye.sunsun.adapter.ConversationAdapter;
import com.itboye.sunsun.address.ConversationModel;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ListView;

public class ForumPostActivity extends Activity {
	private ListView mlListView;// 控件listview
	private ConversationModel model;// 实体类
	private ArrayList<ConversationModel> mlList;// 集合
	private ConversationAdapter mAdapter;//
	private Bitmap mBitmap;// 用于显示固定死的图片

	int mImg[] = { R.drawable.expression, R.drawable.expression,
			R.drawable.expression, R.drawable.expression,
			R.drawable.expression, R.drawable.expression };
	String mName[] = { "柿子", "土豆", "番茄", "牛肉", "猪肉", "羊肉" };

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_forum_post);
		iniView();

	}

	public void iniView() {
		mlListView = (ListView) findViewById(R.id.list);
		mlList = new ArrayList<>();
		for (int i = 0; i < 6; i++) {
			model = new ConversationModel();
			mBitmap = BitmapFactory.decodeResource(getResources(), mImg[i],
					null);
			model.setMhead(mBitmap);
			model.setName(mName[i]);
			model.setContxt("我是楼主");
			model.setTime("2016-03-03");
			model.setContent("森森水族馆欢迎您！森森水族馆欢迎您！");
			mBitmap = BitmapFactory.decodeResource(getResources(),
					R.drawable.forum_hone_ping, null);
			model.setMcomment(mBitmap);
			mBitmap = BitmapFactory.decodeResource(getResources(),
					R.drawable.forum_hone_ping, null);
			model.setMzambia(mBitmap);
			mlList.add(model);

		}
		mAdapter = new ConversationAdapter(mlList, this);
		mlListView.setAdapter(mAdapter);
	}

	public void mOnConVerPost() {

	}

}
